package com.zlx.guguanjia.controller;

import com.zlx.guguanjia.entity.Demand;
import com.zlx.guguanjia.entity.Result;
import com.zlx.guguanjia.service.DemandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author 周罗校
 * @Description
 * @ClassName DemandController
 * @date 2020.10.24 09:54:54
 * 该版权归周罗校所有，最终解释权以官方为准
 */

@RestController
@RequestMapping("/manager/demand")
public class DemandController {
    @Autowired
    private DemandService demandService;
    /***
     * @Author 周罗校
     * @Description 查询列表和分页数据
     * @Param [start, pageSize]
     * @return com.zlx.guguanjia.entity.Result
     * @Date 2020.10.24 10:03:21
     **/
    @GetMapping("selectPage")
    public Result selectPage(int start,int pageSize){
        return new Result(demandService.selectPage(start,pageSize));
    }

    @PutMapping("updateDemandInfo")
    public Result updateDemandById(@RequestBody Demand demand){
        return new Result(demandService.updateByPrimaryKeySelective(demand));
    }
}
